
def intTo2Str( X , K ):
    try:
      X = long( X)
    except:
      X = 0
    try:
      K = int( K)
    except:
      K = 0
    if K<1 :
       K = 1 
    if X<0 :
       FH = 1 ; X = -X
    else:
       FH = 0 
    A =[ 0 for J in xrange( 0, K ) ]
    J = K-1
    while (J>=0) and ( X>0):
          Y = X % 2
          X = X / 2
          A[ J ] = Y
          J = J - 1   
    if FH==1:
      
       for J in xrange( 0, K):
           if A[J] ==1 :
              A[J] = 0
           else:
              A[J] = 1
      
       J = K - 1
       while J>=0:
             A[J] = A[J] +1
             if A[J]<=1:
                break;
             A[J] = 0
             J = J -1
    return "".join([ chr(J+48) for J in A ])
 